<template>
	<view class="school_content">
		 
		 <view class="welcome_img">
			 <image src="@/static/index/index_big.jpg"></image>
		 </view>
		 <view class="card1">
			 <view  class="card_sub" @click="toschooldesc">
				<image class="icon" src="@/static/index/index1.png"></image>
				 <text>中心简介</text>
			 </view>
			 <view  class="card_sub" @click="toschooldeceive">
			 	<image class="icon" src="/static/index/index2.png"></image>
			 	<text>设备情况</text>
			 </view>
		</view>
		
		<view class="card1">
			 <view  class="card_sub"  @click="toschoolpredeceive">
				<image class="icon" src="@/static/index/index3.png"></image>
				 <text>设备预约</text>
			 </view>
			 <view  class="card_sub"  @click="toschoolpreclass">
			 	<image class="icon" src="/static/index/index4.png"></image>
			 	<text>实验室预约</text>
			 </view>
		</view>
		
		<view class="card1">
			 <view  class="card_sub card_sub_big" @click="toschoolmyroomlist">
				<image class="icon" src="@/static/index/index5.png"></image>
				 <text>实验室预约进度查询</text>
			 </view>
			
		</view>
		
		<view class="card1">
			 <view  class="card_sub card_sub_big" @click="toschoolmyequiplist">
				<image class="icon" src="@/static/index/index6.png"></image>
				 <text>设备预约进度查询</text>
			 </view>
			
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				welcome_img:"",
				company_desc:""
			}
		},
		onLoad() {
			uni.setStorageSync('token','0bd75a61111287b5fd1a21883a972339')
		 // uni.login({
		 //   provider: 'weixin', //使用微信登录
		 //   success: function (loginRes) {
		 //     console.log('aaaa=',loginRes.authResult);
		 //   },fail(err) {
		 //   	console.log('fail err=',err);
		 //   }
		 // });
		 this.tocompanyinfo()
		},
		methods: {
			tocompanyinfo(){
				
				//this.$http.requestfast('/api/follower/ld_shoukuan_user/edit', param, 1).then(res => {
				let _that =this
				this.$request.request("api/index/tocompanyinfo?token="+uni.getStorageSync("token"),'',0,'get',false).then(res => {
					console.log('tocompanyinfo=',res);
					
					let res2w = res.data;
					
					console.log("res2w==",res2w)
					
					if (typeof res2w == 'string') {     
					let str22 = res2w.replace(/\ufeff/g, "");//去除反斜杠
					res2w = JSON.parse(str22);//string转object
					}
					
					if (res2w.status == 1) {
					
					            _that.welcome_img=res2w.data.welcome_img
					        
					        }else if(res2w.status==-2){
					
					          uni.showToast({
					            title: "" + res2w.msg,
					            icon: 'none',
					            duration: 3000,
					            success:function(){
					              
					            }
					          });
					          uni.removeStorageSync('token');
					          uni.removeStorageSync('isuser');
					
					          setTimeout(() => {
					            uni.redirectTo({
					              url: '../login/login',
					            })
					          }, 3000);
					
					        }else{
					            
					            uni.showToast({
					              title: "" + res2w.msg,
					              icon: 'none',
					              duration: 3000
					            });
					            
					        }
							
				})
				
			},
			toschooldesc(){
				console.log('toschooldesc----')
				uni.navigateTo({
					url:'/pages/school/desc/desc'
				})
			},
			toschooldeceive(){
				console.log('toschooldeceive')
				uni.navigateTo({
					url:'/pages/school/deceive/index'
				})
			}
			,
			toschoolmyequiplist(){
				console.log('toschoolmyequiplist')
				uni.navigateTo({
					url:'/pages/school/myequiplist/index'
				})
			}
			,
			toschoolpredeceive(){
				console.log('toschoolpredeceive')
				uni.navigateTo({
					url:'/pages/school/predeceive/index'
				})
			},
			toschoolpreclass(){
				console.log('toschoolpreclass')
				uni.navigateTo({
					url:'/pages/school/preclass/index'
				})
			},
			toschoolmyroomlist(){
				console.log('toschoolmyroomlist')
				uni.navigateTo({
					url:'/pages/school/myroomlist/index'
				})
			}
			
			
			
		
		}
	}
</script>

<style>

	page {

	}
	.school_content{
		display: flex;
		flex-direction: column;
		font-weight: bold;
	}
	.card1{
		display: flex;
		flex-direction: row;
		justify-content: space-around;
		justify-items: center;
		align-items: center;
		margin-top:10px;
		
	}

	.welcome_img{
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		width:100%;
	}
	.welcome_img image{
		border:1px solid #cccccc;
		height: 240px;
		width:100%;
	}
	.card_sub{
		display: flex;
		flex-direction: row;
		background-color: white;
		width:100%;
		margin:5px 5px;
		padding:5px 0px;
		
		justify-items: center;
		align-items: center;
		justify-content: space-evenly;
	}
	.card_sub text{
		
	}
	.icon{
		width:50px;
		height:50px;
	}
	
	.card_sub_big{
		justify-content: center;
	}
 
</style>
